import { USERINFO } from "./constans"

//初始化数据
const initialState = {
  user: {
    userId: 1,
    token: "6addc69d278746d88b108b73425d9b14",
    name: "小小窝12",
    phone: "176****0728",
    email: "",
    isAdmin: false
  },
}
//定义reducer函数
function reducer(state = initialState, action) {
  switch (action.type) {
    case USERINFO:
      return {...state, user:action.name}
    default:
      return state
  }
}

export default reducer